/*
 * Copyright 2012-2020. the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. More information from:
 *
 *        https://github.com/fenixsoft
 */

package com.app.dao;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 商品对象模型
 *
 * @author xuejianxinokok@163.com
 * @date 2022/2/22 14:56
 * https://www.cnblogs.com/boywwj/p/8031106.html <br/>
 */
@Entity
@Table(name = Product.TABLE_NAME)
@IdClass(ProductKey.class)
public class Product {
	public static final String TABLE_NAME = "product_virtual";

	// @EmbeddedId
	// private ProductKey id;

	@Id
	// @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@Id
	private String storeId;

	private String title;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getStoreId() {
		return storeId;
	}

	public void setStoreId(String storeId) {
		this.storeId = storeId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Override
	public String toString() {
		return String.format("Product [id=%s, storeId=%s, title=%s]", id, storeId, title);
	}

}
